package com.shlg.chuang.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shlg.chuang.domain.ShowUser;
import com.shlg.chuang.repository.ShowUserRepository;
import com.shlg.chuang.service.ShowUserService;

@Service
public class ShowUserServiceImpl implements ShowUserService{
	
	@Autowired
	private ShowUserRepository showUserRepo;

	@Override
	public ShowUser saveShowUser(ShowUser showUser) {
		return showUserRepo.save(showUser);
	}

	@Override
	public ShowUser updateShowUser(ShowUser showUser) {
		return showUserRepo.save(showUser);
	}

	@Override
	public ShowUser getShowUserByEmailAndPassword(String email, String password) {
		return showUserRepo.findOneByEmailAndPassword(email, password);
	}
	
	@Override
	public ShowUser findById(Long showUserId) {
		return showUserRepo.findOne(showUserId);
	}

	@Override
	public void deleteShowUser(Long showUserId) {
		showUserRepo.delete(showUserId);
	}

	@Override
	public ShowUser findByEmail(String email) {
		return showUserRepo.findOneByEmail(email);
	}
	

}
